package com.lxm.enigma.core;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Lys
 * @Date 2022/5/24
 * @Describe
 **/
@ConfigurationProperties(prefix = "spring.enigma")
public class EnigmaConfig {

    /**
     * AES加密Key
     */
    @Getter
    @Setter
    private String key = "d86d7bab3d6ac01ad9dc6a897652f2d2";

    /**
     * 如果是验签的加密方式，header里的head-name叫啥名字，这里定义
     */
    @Getter
    @Setter
    private String signTag = "signature";

    /**
     * 响应数据编码
     */
    @Getter
    @Setter
    private String responseCharset = "UTF-8";

    /**
     * 开启调试模式，不进行加解密操作
     */
    @Getter
    @Setter
    private boolean debug = false;

    /*
     * filter里只处理以下3个uri-list里的请求
     */


    @Getter
    @Setter
    private List<String> encStreamArray = new ArrayList<>();
    @Getter
    @Setter
    private List<String> encDataArray = new ArrayList<>();
    @Getter
    @Setter
    private List<String> decArray = new ArrayList<>();
    @Getter
    @Setter
    private List<String> signArray = new ArrayList<>();


    /**
     * 过滤器拦截模式
     */
    @Getter
    @Setter
    private String[] urlPatterns = new String[]{"/*"};
}
